package com.hqyj.am.controller;


import com.hqyj.am.pojo.ResultVo;
import com.hqyj.am.pojo.Schedule;
import com.hqyj.am.service.IScheduleService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * 系统设置类
 *
 * @author rock
 * @since 2022-08-16
 */
@RestController
@RequestMapping("/schedule")
public class ScheduleController {

    private IScheduleService scheduleService;

    @Autowired
    public ScheduleController(IScheduleService scheduleService){
        this.scheduleService = scheduleService;
    }

    @GetMapping("/selectLeaveMax")
    public ResultVo selectLeaveMax(String date1, String date2){
        return scheduleService.selectLeaveMax(date1, date2);
    }

    @GetMapping("/selectLateMax")
    public ResultVo selectLateMax(String date1, String date2) {
        return scheduleService.selectLateMax(date1, date2);
    }

    @GetMapping("/selectEarlyMax")
    public ResultVo selectEarlyMax(String date1, String date2) {
        return scheduleService.selectEarlyMax(date1, date2);
    }

    @GetMapping("/selectSystem")
    public ResultVo selectSystem(Schedule schedule) {
        return scheduleService.selectSystem(schedule);
    }

    @PostMapping("/updateSystem")
    public ResultVo updateSystem(Schedule schedule) {
        return scheduleService.updateSystem(schedule);
    }

    @GetMapping("/test")
    public ResultVo test(int i) {
        return scheduleService.test(i);
    }
}

